/*
 * Copyright (c) 2019 Author: Fancyears Milos Malvis @1243093366@qq.com
 * ALL COPYRIGHT REVERSED.
 */

package com.fancyears.encrypt;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

/**
 * @Author: Fancyears Milos Malvis
 * @Date: Created in  2019/6/20 15:42
 * @Modified By:
 */
public class Base64Decode {
    /**
     * 描述
     *
     * @param
     * @return String
     * @author ***
     */
    public static String getRsaKeyResource(String rsaKeyResource) {
        InputStream inputStream = null;
        InputStreamReader isr = null;
        BufferedReader br = null;
        StringBuffer sb = new StringBuffer();
        try {
            inputStream = Base64Decode.class.getResourceAsStream(rsaKeyResource);
            isr = new InputStreamReader(inputStream);
            br = new BufferedReader(isr);
            String str;
            while ((str = br.readLine()) != null) {
                sb.append(str);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (br != null) {
                    br.close();
                }
                if (isr != null) {
                    isr.close();
                }
                if (inputStream != null) {
                    inputStream.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }

        }

        return sb.toString();
    }

}
